<%@ include file="connect.jsp" %>

<%
    String cat = request.getParameter("cathdn");
    String namaCat = request.getParameter("nama");
    String idnya = request.getParameter("id");
    if (namaCat == null && namaCat == " ") {
        response.sendRedirect("categories.jsp?respon=Please insert the category's name!");
    } else {
        stat.executeUpdate("Update CATEGORIES set categoryName = '" + namaCat + "' where categoryID = '" + idnya + "' ");
        response.sendRedirect("categories.jsp?respon=Category " + cat + " has been updated to " + namaCat);

    }

%>